cmake_minimum_required(VERSION 3.22)
project(TRUST-CLUSTERING)

set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)

set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 20)

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -Wall -g -fstack-protector-all")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -Wall -g -fstack-protector-all")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O2")

# 查找 libuv


add_library(udpService src/UdpService.cpp src/UdpService.h
        src/globalDefine.h)
target_link_libraries(udpService uv)
add_executable(udptest udptest.cpp)

target_link_libraries(udptest udpService dl)
#add_executable(SEC_LEAD src/SEC_LEAD.cpp src/SEC_LEAD.h)

add_library(SEC_LEAD src/SEC_LEAD.cpp src/SEC_LEAD.h
        src/globalDefine.h src/nodeDiscovery.pb.h src/nodeDiscovery.pb.cc)
target_link_libraries(SEC_LEAD udpService dl)
add_library(cryptography src/CryptogrtaphyTools/ECCOperator.cpp src/CryptogrtaphyTools/ECCOperator.h
        src/CryptogrtaphyTools/Deleter.h
        src/CryptogrtaphyTools/SymmetricEncryption.cpp
        src/CryptogrtaphyTools/SymmetricEncryption.h)
